package cn.zh.handlers;

import cn.zh.commons.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author : 张航
 * @date : 2024-05-14 20:21
 * @description:
 **/
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public ResponseResult allExceptionHandler(Exception e){
        e.printStackTrace();
        return  ResponseResult.error().message("服务器异常……");
    }
}
